package com.ruoyi.log.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.log.mapper.OperationLogMapper;
import com.ruoyi.log.domain.OperationLog;
import com.ruoyi.log.service.IOperationLogService;

/**
 * 操作日志Service业务层处理
 * 
 * @author sqlstudent
 * @date 2025-06-29
 */
@Service
public class OperationLogServiceImpl implements IOperationLogService 
{
    @Autowired
    private OperationLogMapper operationLogMapper;

    /**
     * 查询操作日志
     * 
     * @param id 操作日志主键
     * @return 操作日志
     */
    @Override
    public OperationLog selectOperationLogById(Long id)
    {
        return operationLogMapper.selectOperationLogById(id);
    }

    /**
     * 查询操作日志列表
     * 
     * @param operationLog 操作日志
     * @return 操作日志
     */
    @Override
    public List<OperationLog> selectOperationLogList(OperationLog operationLog)
    {
        return operationLogMapper.selectOperationLogList(operationLog);
    }

    /**
     * 新增操作日志
     * 
     * @param operationLog 操作日志
     * @return 结果
     */
    @Override
    public int insertOperationLog(OperationLog operationLog)
    {
        operationLog.setCreateTime(DateUtils.getNowDate());
        return operationLogMapper.insertOperationLog(operationLog);
    }

    /**
     * 修改操作日志
     * 
     * @param operationLog 操作日志
     * @return 结果
     */
    @Override
    public int updateOperationLog(OperationLog operationLog)
    {
        return operationLogMapper.updateOperationLog(operationLog);
    }

    /**
     * 批量删除操作日志
     * 
     * @param ids 需要删除的操作日志主键
     * @return 结果
     */
    @Override
    public int deleteOperationLogByIds(Long[] ids)
    {
        return operationLogMapper.deleteOperationLogByIds(ids);
    }

    /**
     * 删除操作日志信息
     * 
     * @param id 操作日志主键
     * @return 结果
     */
    @Override
    public int deleteOperationLogById(Long id)
    {
        return operationLogMapper.deleteOperationLogById(id);
    }
}
